//
//  sinTopicTVCell.m
//  InSuger
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "sinTopicTVCell.h"

@implementation sinTopicTVCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self  = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell
{
    self.bottomImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.bottomImageView];
    
    self.picImageView = [[UIImageView alloc] init];
    [self.bottomImageView addSubview:self.picImageView];

    self.titleLabel = [[UILabel alloc] init];
    [self.bottomImageView addSubview:self.titleLabel];
    self.titleLabel.font = [UIFont systemFontOfSize:13.0];
    self.titleLabel.textColor = [UIColor grayColor];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews
{

    [super layoutSubviews];
    self.bottomImageView.frame = CGRectMake(self.contentView.frame.size.width / 41, self.contentView.frame.size.height / 74, 39 * self.contentView.frame.size.width / 41, 72 * self.contentView.frame.size.height / 74);
    self.picImageView.frame = CGRectMake(1 * self.bottomImageView.frame.size.width / 82, 2 * self.bottomImageView.frame.size.height / 148, 80 * self.bottomImageView.frame.size.width / 82, 104 * self.bottomImageView.frame.size.height / 148);
    self.titleLabel.frame = CGRectMake(0, 106 * self.bottomImageView.frame.size.height / 148, self.bottomImageView.frame.size.width, 42 * self.bottomImageView.frame.size.height / 148);
    
    @weakify(self);
    [self addColorChangedBlock:^() {
        @strongify(self);
        self.nightBackgroundColor = UIColorFromRGB(0x343434);
        self.normalBackgroundColor = [UIColor whiteColor];
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
